package cn.ckx.coding.common.dto;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName BaseEntity
 * @Description mybatis基础类
 *
 *     如果子类需要实现逻辑删除功能，就在子类上新增字段，并启用逻辑删除的注解
 *     @TableLogic
 *     private int enabledFlag;
 *
 *
 * @Author kunxin.cai
 * @Date 2021/2/26
 * @Version 1.0
 **/
@Data
public class BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId
    private String id;
    
    @TableField(fill = FieldFill.INSERT)
    private String createId;

    @TableField(fill = FieldFill.INSERT)
    private String createName;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateId;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateName;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    
    @Version
    private int version;

}
